package de.gwtprime.server.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import de.gwtprime.server.sql.StockReader;


public class ImportStockData extends HttpServlet{

	/**
	 * Servlet to import stock data.
	 * Is called from cron-job
	 */
	private static final long serialVersionUID = -5457963925862281615L;
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		int rows = StockReader.readSingleStock();
		
		
		resp.getWriter().write("imported rows: "+rows);
	}

}
